<link rel="stylesheet" type="text/css" href="/ast/admin-xt/css/style.css">
<script src="/ast/admin-xt/js/jquery.js"></script>
<script src="/ast/admin-xt/js/jquery.mCustomScrollbar.concat.min.js"></script>
<link rel='stylesheet' href='/ast/message/message.min.css'>
<script src='/ast/message/message.min.js'></script>
<script src="/ast/user.js"></script>
<header>
 <h1><img src="/ast/photo/favicon.ico"/></h1>
 <ul class="rt_nav">
  <li><a href="/"  class="website_icon">返回首页</a></li>
  <li><a href="javascript:window.location.reload(false);" class="clear_icon">清除缓存</a></li>
  <li><a href="#" id='pop-set' class="set_icon">账号设置</a></li>
  <li><a href="javascript:useradmin.outlogin();" class="quit_icon">退出登录</a></li>
 </ul>
</header>

<section class="pop_bg">
      <div class="pop_cont">
       <h3>账号设置</h3>
       <div class="pop_cont_input">
        <ul>
         <li>
          <span>新密码</span>
          <input type="text" placeholder="New password-不改别填" id="passwordnew"/>
         </li>
        </ul>
       </div>
       <div class="pop_cont_text">
        牢记密码！
       </div>
       <div class="btm_btn">
        <input type="button" id='newpassbutton' value="确认" class="input_btn trueBtn"/>
        <input type="button" value="关闭" class="input_btn falseBtn"/>
       </div>
      </div>
     </section>
     <section class="loading_area">
      <div class="loading_cont">
       <div class="loading_icon"><i></i><i></i><i></i><i></i><i></i></div>
       <div class="loading_txt"><mark>数据正在加载，请稍后！</mark></div>
      </div>
     </section>
<aside class="lt_aside_nav content mCustomScrollbar">
 <h2><a href="./">首页</a></h2>
 <ul>
  <li>
   <dl>
    <dt>书籍收集</dt>
    <dd><a href="likebook.php" class="active">书籍-收藏</a></dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>社区交流</dt>
    <dd>
    <a href="javascript:void(0);" onclick="location.href='mypost.php?userid=' + sessionStorage.getItem('user');">我的帖子</a>
</dd>
   </dl>
  </li>
  <li>
   <dl>
    <dt>写作助手</dt>
    <dd>
    <a href="javascript:void(0);" onclick="location.href='geter.php?userid=' + sessionStorage.getItem('user');">资格申请</a>
</dd>
<dd>
    <a href="javascript:void(0);" onclick="location.href='myprojectnovel.php?userid=' + sessionStorage.getItem('user');">作品管理</a>
 </dd>  
</dl>
  </li>
  <li>
   <dl>
    <dt>其它</dt>
    <dd><a href="message.php">消息中心</a></dd>
   </dl>
  </li>
  <li>
   <p class="btm_infor">© 云汐工作室</p>
  </li>
 </ul>
</aside>
<script>
    useradmin.check_login();
</script>
<script>
     $(document).ready(function(){
		 $("#pop-set").click(function(){
			 $(".pop_bg").fadeIn();
			 });
		 $(".falseBtn").click(function(){
			 $(".pop_bg").fadeOut();
			 });
		 });
     </script>
         <script>
        function loading_load_show(){
			$(".loading_area").fadeIn();
        }
        function loading_load_hide(){
            $(".loading_area").fadeOut();
        }
     </script>
     <script>
        $(document).ready(function(){
            $("#newpassbutton").click(function(){
                var newpassword = $("#passwordnew").val();
                if (newpassword === null || newpassword.length < 6) {
                    Qmsg.error('新密码不能为空，且长度不能小于6位');
                } else {
                    loading_load_show();
                    fetch('ht/changepassword.php?userid='+sessionStorage.getItem('user')+'&newpassword='+newpassword)
                    .then(response => response.json())
                    .then(data => {
                        if (data.code === 200) {
                            Qmsg.success(data.msg);
                        } else {
                            Qmsg.error(data.msg);
                        }
                        loading_load_hide();
                        useradmin.outlogin();
                    })
                }
            });
        });
     </script>